#include <boost/filesystem.hpp>
#include <boost/date_time/posix_time/posix_time_io.hpp>
#include <boost/date_time/posix_time/conversion.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/c_local_time_adjustor.hpp>

void PrintTime(boost::filesystem::path _file) {
    using boost::posix_time::ptime;
    using adj = boost::date_time::c_local_adjustor<ptime>;

    time_t const sys_time = last_write_time(_file);
    ptime const utc = boost::posix_time::from_time_t(sys_time);
    ptime const local = adj::utc_to_local(utc);

    std::cout << "utc: " << utc << "\n";
    std::cout << "local: " << local << "\n";
    {
        long h{ local.time_of_day().hours() };
        long m{ local.time_of_day().minutes() };
        long s{ local.time_of_day().seconds() };

        //...print h, m, s.
        std::cout << h << ":" << m << ":" << s << '\n';
    }
}

int main(int argc, char* argv[]) {
    PrintTime(argv[1]);
    return 0;
}